package com.iflytek.springboot_medicine.service;

import com.iflytek.springboot_medicine.entity.Shopping;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface ShoppingRepository extends JpaRepository<Shopping, Integer> {
    @Modifying
    @Query("DELETE FROM Shopping s WHERE s.medicineId = :medicineId")
    void deleteByMedicineId(@Param("medicineId") int medicineId);
}
